package com.xinchuang.controller.targetSystem.configure;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xinchuang.common.Result;
import com.xinchuang.common.ResultEnum;
import com.xinchuang.common.ResultUtil;
import com.xinchuang.entity.targetSystem.AirPlane;
import com.xinchuang.entity.targetSystem.object.CommonAdd;
import com.xinchuang.entity.targetSystem.object.SpecialAdd;
import com.xinchuang.entity.targetSystem.system.PostureType;
import com.xinchuang.entity.targetSystem.system.TargetType;
import com.xinchuang.entity.targetSystem.target.KnowData;
import com.xinchuang.fiter.NoToken;
import com.xinchuang.service.targetSystem.AirPlaneService;
import com.xinchuang.service.targetSystem.CommonService;
import com.xinchuang.service.targetSystem.KnowService;
import com.xinchuang.service.targetSystem.TargetTypeService;
import com.xinchuang.vo.AirPlaneVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * @ClassName ConfigureController
 * @Description: TODO(系统信息controller)
 * @Author zhangxuan
 * @Date 2021-03-25 11:34
 * @Verion V1.0
 */
@Api(value = "系统信息controller", tags = {"信息维护接口config"})
@RequestMapping(value = "/config")
@RestController
public class ConfigureController {

    @Resource
    private CommonService commonService;

    @Resource
    private TargetTypeService targetTypeService;

    @Resource
    private KnowService knowService;

    @Resource
    private AirPlaneService airPlaneService;

    /**
     * 改变共有属性
     */
    private final String CHANGE_COMMON_MAIN_DATA = "/common/main/data";
    /**
     * 共有属性排序
     */
    private final String CHANGE_COMMON_SORT = "/common/sort";
    /**
     * 私有属性排序
     */
    private final String CHANGE_SPECIAL_SORT = "/special/sort";
    /**
     * 私有属性排序
     */
    private final String CHANGE_POSTURE_SORT = "/posture/sort";
    /**
     * 查询目标专有属性
     */
    private final String CHANGE_PRIVATE_DATA = "/private/data";
    /**
     * 查询态势专有属性
     */
    private final String CHANGE_POSTURE_DATA = "/posture/data";
    /**
     * 改变类别专有属性
     */
    private final String CHANGE_PRIVATE_TREE = "/private/tree";
    /**
     * 查询目标与子目标类型综合树
     */
    private final String TARGET_SUB_TYPE_TREE = "/targetAndSubTypeTree";
    /**
     * 改变态势属性
     */
    private final String CHANGE_POSTURE_TREE = "/posture/tree";
    /**
     * 下拉列表选择类别
     */
    private final String SELECT_TYPE_PULL_DOWN = "/type/pull";
    /**
     * 下拉列表选择类别
     */
    private final String SELECT_POSTURE_PULL_DOWN = "/posture/pull";
    /**
     * 下拉列表选择类别
     */
    private final String SELECT_TARGET_TYPE_PULL_DOWN = "/type/pulls";
    /**
     * 移动目标类型
     */
    private final String MOVE_TYPE_SORT = "/moveType";
    /**
     * 知识维护
     */
    private final String KNOW_DATA = "/know/data";
    /**
     * 知识关系维护
     */
    private final String KNOW_RELATION_DATA = "/know/relation/data";
    /**
     * 系统与体系下拉列表
     */
    private final String KNOW_PUT_DATA = "/know/put";
    /**
     * 系统与体系树
     */
    private final String KNOW_TREE_DATA = "/know/tree";
    /**
     * 查询指标下拉列表
     */
    private final String KNOW_INDEX_PUT_DATA = "/know/index/put";
    /**
     * 查询系统关联分析
     */
    private final String KNOW_SYSTEM_DATA = "/know/system/data";
    /**
     * 查询系统关联上图
     */
    private final String KNOW_SYSTEM_MAP = "/know/system/map";
    /**
     * 查询体系关联分析
     */
    private final String KNOW_SYSTEMS_DATA = "/know/systems/data";
    /**
     * 价值分析(体系)
     */
    private final String VALUE_ANALYZE_DATA = "/know/value/data";
    /**
     * 价值分析(系统)
     */
    private final String VALUE_ANALYZE_SYSTEM_DATA = "/know/value/system/data";
    /**
     * 价值分析(目标)
     */
    private final String VALUE_ANALYZE_TARGET_DATA = "/know/value/target/data";

    /**
     * 获取行政区域
     */
    private final String GET_REGION = "/region";

    /**
     * 获取region和中心点
     */
    private final String GET_CENTER = "/center";

    /**
     * 系统/体系下拉列表
     */
    private final String GET_SYSTEM_PUT = "/systemPut";

    private final String AIR_PLANE_INTERFACE = "/airPlane";

    /**
     * 更新字符
     */
    private final String UPDATE_FONT = "/updateFont";

    /**
     * 查询字符
     */
    private final String GET_FONT = "/getFont";

    @ApiOperation(value = "查询目标共有属性")
    @GetMapping(CHANGE_COMMON_MAIN_DATA)
    public Result<List<Map<String, Object>>> selectTargetCommonData(
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "status", required = true) String status
    ) {
        switch (status) {
            case "main":
            case "sub":
                return commonService.selectCommonList(pageNum, pageSize, status);
            default:
                break;
        }
        return ResultUtil.error(ResultEnum.STATUS_EMPTY);
    }

    @ApiOperation(value = "新增目标共有属性")
    @PostMapping(CHANGE_COMMON_MAIN_DATA)
    public Result addCommonData(
            @Validated @RequestBody CommonAdd commonAdd
    ) {
        return commonService.addCommon(commonAdd);
    }

    @ApiOperation(value = "修改目标共有属性")
    @PutMapping(CHANGE_COMMON_MAIN_DATA)
    public Result updateCommonData(
            @RequestBody CommonAdd commonAdd
    ) {
        return commonService.updateCommon(commonAdd);
    }

    @ApiOperation(value = "删除目标共有属性")
    @DeleteMapping(CHANGE_COMMON_MAIN_DATA)
    public Result deleteCommonData(
            @RequestParam(value = "id", required = true) String id
    ) {
        if (StringUtils.isBlank(id)) {
            return ResultUtil.error(ResultEnum.DELETE_EMPTY);
        }
        return commonService.delCommon(id);
    }

    @ApiOperation(value = "查询目标专有属性")
    @GetMapping(CHANGE_PRIVATE_DATA)
    public Result<Map<String, Object>> selectTargetOnlyData(
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "typeId", required = false) String typeId
    ) {
        return targetTypeService.selectSpecialAttribute(pageNum, pageSize, typeId);
    }

    @ApiOperation(value = "新增专有属性")
    @PostMapping(CHANGE_PRIVATE_DATA)
    public Result addSpecial(
            @Validated @RequestBody SpecialAdd specialAdd
    ) {
        return targetTypeService.addSpecialAttribute(specialAdd);
    }

    @ApiOperation(value = "修改专有属性")
    @PutMapping(CHANGE_PRIVATE_DATA)
    public Result updateSpecial(
            @Validated @RequestBody SpecialAdd specialAdd
    ) {
        return targetTypeService.updateSpecialAttribute(specialAdd);
    }

    @ApiOperation(value = "删除专有属性")
    @DeleteMapping(CHANGE_PRIVATE_DATA)
    public Result deleteSpecial(
            @RequestParam(value = "id") String id
    ) {
        return targetTypeService.delSpecialAttribute(id);
    }

    @ApiOperation(value = "查询态势属性")
    @GetMapping(CHANGE_POSTURE_DATA)
    public Result<Map<String, Object>> selectPostureOnlyData(
            @RequestParam(value = "pageNum", required = false) Integer pageNum,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "typeId", required = false) String typeId
    ) {
        return targetTypeService.selectPostureAttribute(pageNum, pageSize, typeId);
    }

    @ApiOperation(value = "新增态势属性")
    @PostMapping(CHANGE_POSTURE_DATA)
    public Result addPosture(
            @Validated @RequestBody SpecialAdd specialAdd
    ) {
        return targetTypeService.addPostureAttribute(specialAdd);
    }

    @ApiOperation(value = "修改态势属性")
    @PutMapping(CHANGE_POSTURE_DATA)
    public Result updatePosture(
            @Validated @RequestBody SpecialAdd specialAdd
    ) {
        return targetTypeService.updatePostureAttribute(specialAdd);
    }

    @ApiOperation(value = "删除态势属性")
    @DeleteMapping(CHANGE_POSTURE_DATA)
    public Result deletePosture(
            @RequestParam(value = "id") String id
    ) {
        return targetTypeService.delPostureAttribute(id);
    }

    @ApiOperation(value = "新增类别树")
    @PostMapping(CHANGE_PRIVATE_TREE)
    public Result addPrivateTree(
            @Validated @RequestBody TargetType targetType
    ) {
        return targetTypeService.addTargetType(targetType);
    }

    @ApiOperation(value = "修改类别树")
    @PutMapping(CHANGE_PRIVATE_TREE)
    public Result updatePrivateTree(
            @RequestBody TargetType targetType
    ) {
        return targetTypeService.updateTargetType(targetType);
    }

    @ApiOperation(value = "删除类别树")
    @DeleteMapping(CHANGE_PRIVATE_TREE)
    public Result deletePrivateTree(
            @RequestParam(value = "typeId", required = false) String typeId
    ) {
        return targetTypeService.delTargetType(typeId);
    }

    @NoToken
    @ApiOperation(value = "查询类别树")
    @GetMapping(CHANGE_PRIVATE_TREE)
    public Result selectPrivateTree() {
        return targetTypeService.selectTargettype();
    }

    @NoToken
    @ApiOperation(value = "查询目标与子目标类型综合树")
    @GetMapping(TARGET_SUB_TYPE_TREE)
    public Result targetAndSubTypeTree() {
        return targetTypeService.selectTargetAndSubTypeTree();
    }

    @ApiOperation(value = "新增态势树")
    @PostMapping(CHANGE_POSTURE_TREE)
    public Result addPostureTree(
            @Validated @RequestBody PostureType postureType
    ) {
        return targetTypeService.addPostureType(postureType);
    }

    @ApiOperation(value = "修改态势树")
    @PutMapping(CHANGE_POSTURE_TREE)
    public Result updatePostureTree(
            @RequestBody PostureType postureType
    ) {
        return targetTypeService.updatePostureType(postureType);
    }

    @ApiOperation(value = "删除态势树")
    @DeleteMapping(CHANGE_POSTURE_TREE)
    public Result deletePostureTree(
            @RequestParam(value = "typeId", required = true) String typeId
    ) {
        return targetTypeService.deletePostureType(typeId);
    }

    @NoToken
    @ApiOperation(value = "查询态势树")
    @GetMapping(CHANGE_POSTURE_TREE)
    public Result selectPostureTree() {
        return targetTypeService.selectPostureType();
    }

    @ApiOperation(value = "下拉列表选择类别")
    @GetMapping(SELECT_TYPE_PULL_DOWN)
    public Result selectTypePullDown(
            @RequestParam(value = "targetId", required = false) String targetId,
            @RequestParam(value = "isSub", required = false) String isSub
    ) {
        return targetTypeService.selectTypePullDown(targetId, isSub);
    }

    @ApiOperation(value = "下拉列表选择态势类别")
    @GetMapping(SELECT_POSTURE_PULL_DOWN)
    public Result selectTypePullDown() {
        return targetTypeService.selectPosturePullDown();
    }

    @ApiOperation(value = "下拉列表选择类别")
    @GetMapping(SELECT_TARGET_TYPE_PULL_DOWN)
    public Result selectTypePullDowns(
            @RequestParam(value = "typeId") String parantId
    ) {
        return targetTypeService.selectTypePull(parantId);
    }

    @ApiOperation(value = "移动类型属性")
    @GetMapping(MOVE_TYPE_SORT)
    public Result moveType(
            @RequestParam(value = "typeId") String typeId,
            @RequestParam(value = "type") String type
    ) {
        return targetTypeService.moveSpecialAttribute(typeId, type);
    }

    @ApiOperation(value = "新增知识维护")
    @PostMapping(KNOW_DATA)
    public Result addKonw(
            @RequestBody JSONObject json,
            HttpServletResponse response
    ) {
        KnowData knowData = new KnowData();
        knowData.setRelId(json.getString("relId"));
        knowData.setKind(json.getString("kind"));
        knowData.setName(json.getString("name"));
        knowData.setType(json.getString("type"));
        knowData.setIndexData(CollectionUtil.isNotEmpty(json.getJSONArray("index")) ? json.getJSONArray("index").toJSONString() : "[]");
        knowData.setRemark(json.getString("describe"));
        knowData.setWeapon(json.getString("weapon"));
        return knowService.addKnow(knowData, json.getInteger("sign"), response.getHeader("userId"));
    }

    @ApiOperation(value = "修改知识维护")
    @PutMapping(KNOW_DATA)
    public Result updateKonw(
            @RequestBody JSONObject json,
            HttpServletResponse response
    ) {
        KnowData knowData = new KnowData();
        knowData.setId(json.getString("id"));
        knowData.setRelId(json.getString("relId"));
        knowData.setKind(json.getString("kind"));
        knowData.setName(json.getString("name"));
        knowData.setType(json.getString("type"));
        knowData.setIndexData(CollectionUtil.isNotEmpty(json.getJSONArray("index")) ? json.getJSONArray("index").toJSONString() : "[]");
        knowData.setRemark(json.getString("describe"));
        knowData.setWeapon(json.getString("weapon"));
        return knowService.addKnow(knowData, json.getInteger("sign"), response.getHeader("userId"));
    }

    @ApiOperation(value = "删除知识维护")
    @DeleteMapping(KNOW_DATA)
    public Result deleteKonw(
            @RequestParam("id") String id,
            @RequestParam("sign") int sign
    ) {
        return knowService.deleteKnow(id, sign);
    }

    @ApiOperation(value = "查询知识维护")
    @GetMapping(KNOW_DATA)
    public Result selectKnow(
            @RequestParam("relId") String relId,
            @RequestParam("sign") int sign,
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
            @RequestParam(value = "type", required = false) String type
    ) {
        return knowService.selectKnowList(pageNum, pageSize, relId, sign, type);
    }

    @ApiOperation(value = "查询知识关系维护")
    @GetMapping(KNOW_RELATION_DATA)
    public Result selectKnowRelation(
            @RequestParam("id") String id,
            @RequestParam("sign") int sign
    ) {
        return knowService.selectKnowRelationList(id, sign);
    }

    @ApiOperation(value = "删除知识关系维护")
    @DeleteMapping(KNOW_RELATION_DATA)
    public Result deleteKnowRelation(
            @RequestParam("knowId") String knowId,
            @RequestParam("id") String id,
            @RequestParam("sign") int sign
    ) {
        return knowService.deleteKnowRelation(knowId, id, sign);
    }

    @ApiOperation(value = "新增知识关系维护")
    @PostMapping(KNOW_RELATION_DATA)
    public Result addKnowRelation(
            @RequestBody JSONObject json
    ) {
        String id = json.getString("id");
        int sign = json.getInteger("sign");
        JSONArray array = json.getJSONArray("relList");
        String detColumns = "[]";
        if (CollectionUtil.isNotEmpty(json.getJSONArray("detColumns"))) {
            detColumns = json.getJSONArray("detColumns").toJSONString();
        }
        return knowService.addKnowRelation(id, sign, array, detColumns);
    }

    @ApiOperation(value = "查询系统/体系下拉列表")
    @GetMapping(KNOW_PUT_DATA)
    public Result selectKnowPut(
            @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
            @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
            @RequestParam("sign") int sign
    ) {
        return knowService.selectPut(sign, pageNum, pageSize);
    }

    @ApiOperation(value = "查询目标/系统/体系树")
    @GetMapping(KNOW_TREE_DATA)
    public Result selectKnowTree(
            @RequestParam("sign") int sign,
            @RequestParam(value = "keyword", required = false) String keyword,
            @RequestParam(value = "country", required = false) String country,
            @RequestParam(value = "classify", required = false) String classify
    ) {

        return knowService.selectTree(sign, keyword, country, classify);
    }

    @ApiOperation(value = "查询指标选择下拉列表")
    @GetMapping(KNOW_INDEX_PUT_DATA)
    public Result selectKnowIndexPut(
            @RequestParam("type") int type,
            @RequestParam(value = "targetType", required = false) Integer target,
            @RequestParam(value = "relId", required = false) String relId,
            @RequestParam(value = "sign", required = false) Integer sign
    ) {
        return knowService.selectIndexPut(type, target, sign, relId);
    }

    @ApiOperation(value = "查询系统分析")
    @GetMapping(KNOW_SYSTEM_DATA)
    public Result selectKnowSystemData(
            @RequestParam("sId") String sId,
            @RequestParam("type") int sign
    ) {
        if (sign == 3) {
//            return knowService.selectSystemCrucialAnalyze(sId);
            return knowService.selectSystemYH(sId, true);
        } else if (sign == 4) {
            Map<String, Object> map = knowService.selectSystemBlowAnalyze(sId);
            return ResultUtil.success(map);
        } else if (sign == 5) {
            return knowService.selectSystemYHInit(sId);
        }
        return knowService.selectSystemAnalyze(sId, sign);
    }

    @ApiOperation(value = "查询系统关联上图")
    @GetMapping(KNOW_SYSTEM_MAP)
    public Result selectKnowSystemMap(
            @RequestParam("sId") String sId,
            @RequestParam("type") int sign
    ) {
        return knowService.selectSystemAnalyzeMap(sId, sign);
    }

    @ApiOperation(value = "查询体系分析")
    @GetMapping(KNOW_SYSTEMS_DATA)
    public Result selectKnowSystemsData(
            @RequestParam("sysId") String sysId,
            @RequestParam("type") int sign
    ) {
        if (sign == 3) {
//            return knowService.selectSystemsCrucialAnalyze(sysId);
            return knowService.selectSystemYH(sysId, false);
        } else if (sign == 4) {
//            Map<String, Object> map = knowService.selectSystemsBlowAnalyze(sysId);
            return knowService.blowLevel(sysId);
        } else if (sign == 5) {
            return knowService.selectSystemYHInit(sysId);
        }
        return knowService.selectSystemsAnalyze(sysId, sign);
    }

    @ApiOperation(value = "查询价值分析(体系)")
    @GetMapping(VALUE_ANALYZE_DATA)
    public Result selectValueData(
            @RequestParam(value = "sysId", required = false) String sysId,
            @RequestParam(value = "sId", required = false) String sId,
            @RequestParam(value = "targetId", required = false) String targetId,
            @RequestParam("type") int sign
    ) {
        if (StringUtils.isBlank(sysId)) {
            return knowService.selectValueSystemAnalyze(sId, targetId, sign);
        }
        return knowService.selectValueAnalyze(sysId, sId, targetId, sign);
    }

    @ApiOperation(value = "新增价值分析(体系)")
    @PostMapping(VALUE_ANALYZE_DATA)
    public Result addValueData(
            @RequestBody JSONObject json
    ) {
        if (StringUtils.isBlank(json.getString("sysId"))) {
            return knowService.addValueSystem(
                    json.getString("id"),
                    json.getString("sId"),
                    json.getString("targetId"),
                    json.getString("knowId"),
                    json.getDouble("score"),
                    json.getDouble("weight"));
        }
        return knowService.addValue(
                json.getString("id"),
                json.getString("sysId"),
                json.getString("sId"),
                json.getString("targetId"),
                json.getString("knowId"),
                json.getDouble("score"),
                json.getDouble("weight"));
    }

    @ApiOperation(value = "查询价值分析(系统)")
    @GetMapping(VALUE_ANALYZE_SYSTEM_DATA)
    public Result selectValueSystemData(
            @RequestParam(value = "sId") String sId,
            @RequestParam(value = "targetId", required = false) String targetId,
            @RequestParam("type") int sign
    ) {
        return knowService.selectValueSystemAnalyze(sId, targetId, sign);
    }

    @ApiOperation(value = "新增价值分析(系统)")
    @PostMapping(VALUE_ANALYZE_SYSTEM_DATA)
    public Result addValueSystemData(
            @RequestBody JSONObject json
    ) {
        synchronized (this) {
            return knowService.addValueSystem(
                    json.getString("id"),
                    json.getString("sId"),
                    json.getString("targetId"),
                    json.getString("knowId"),
                    json.getDouble("score"),
                    json.getDouble("weight"));
        }
    }

    @ApiOperation(value = "查询价值分析(目标)")
    @GetMapping(value = VALUE_ANALYZE_TARGET_DATA)
    public Result selectValueTargetData(
            @RequestParam(value = "targetId") String targetId
    ) {
        return knowService.selectValueTargetAnalyze(targetId);
    }

    @ApiOperation(value = "新增价值分析(目标)")
    @PostMapping(value = VALUE_ANALYZE_TARGET_DATA)
    public Result addValueTargetData(
            @RequestBody JSONObject json
    ) {
        return knowService.addValueTarget(
                json.getString("id"),
                json.getString("targetId"),
                json.getString("knowId"),
                json.getDouble("score"),
                json.getDouble("weight"));
    }

    @ApiOperation(value = "目标要害价值分析(目标)")
    @PutMapping(value = VALUE_ANALYZE_TARGET_DATA)
    public Result selectTargetAnalyzeValue(
            @RequestBody JSONObject json
    ) {
        List<Map> list = null;
        if (CollectionUtil.isNotEmpty(json.getJSONArray("dataList"))) {
            list = json.getJSONArray("dataList").toJavaList(Map.class);
        }
        return knowService.selectTargetAnalyzeValue(json.getString("targetId"), list);
    }

    @ApiOperation(value = "共有属性排序")
    @GetMapping(value = CHANGE_COMMON_SORT)
    public Result getCommonSort(
            @RequestParam(value = "id") String id,
            @RequestParam(value = "sign") int sign
    ) {
        return commonService.getCommonSort(id, sign);
    }

    @ApiOperation(value = "私有属性排序")
    @GetMapping(value = CHANGE_SPECIAL_SORT)
    public Result getSpecialSort(
            @RequestParam(value = "id") String id,
            @RequestParam(value = "sign") int sign
    ) {
        return targetTypeService.getSpecialSort(id, sign);
    }

    @ApiOperation(value = "态势属性排序")
    @GetMapping(value = CHANGE_POSTURE_SORT)
    public Result getPostureSort(
            @RequestParam(value = "id") String id,
            @RequestParam(value = "sign") int sign
    ) {
        return targetTypeService.getPostureSort(id, sign);
    }

    @ApiOperation(value = "获取行政区域")
    @GetMapping(value = GET_REGION)
    public Result getRegion(
            @RequestParam(value = "country", required = false) String country,
            @RequestParam(value = "level", required = false) String level
    ) {
        return commonService.getCountryList(country, level);
    }

    @ApiOperation(value = "获取region和中心点")
    @GetMapping(value = GET_CENTER)
    public Result getCenter(
            @RequestParam(value = "country", required = false) String country,
            @RequestParam(value = "adcode", required = false) String adcode
    ) {
        return commonService.getRegionAndCenter(adcode, country);
    }

    @ApiOperation(value = "系统/体系下拉列表")
    @GetMapping(value = GET_SYSTEM_PUT)
    public Result getSystemPut(
            @RequestParam(value = "type") Integer type
    ) {
        return knowService.selectSysType(type);
    }

    @PostMapping(AIR_PLANE_INTERFACE)
    public Result addOrUpdatePlane(@RequestBody AirPlaneVo airPlane) {
        return airPlaneService.addOrUpdateAirPlane(airPlane);
    }

    @DeleteMapping(AIR_PLANE_INTERFACE)
    public Result deletePlane(@RequestParam(value = "id") String id) {
        return airPlaneService.deletePlane(id);
    }

    @GetMapping(AIR_PLANE_INTERFACE)
    public Result selectPlaneOnly(@RequestParam(value = "id") String id) {
        return airPlaneService.selectPlaneOnly(id);
    }

    @GetMapping(value = "/planeList")
    public Result selectPlaneList(
            @RequestParam(value = "pagecur", defaultValue = "1") Integer pagecur,
            @RequestParam(value = "pagesise", defaultValue = "10") Integer pagesise,
            @RequestParam(value = "isPull") Boolean isPull
    ) {
        return airPlaneService.selectPlaneList(isPull, pagecur, pagesise);
    }

    @PostMapping(value = UPDATE_FONT)
    public Result updateFont(@RequestBody JSONObject json) {
        return commonService.updateFont(json);
    }

    @PostMapping(value = GET_FONT)
    public Result getFont(@RequestBody JSONObject json) {
        return commonService.getFont(json);
    }

}